package com.tian.system.common.security;

import com.tian.framework.security.domian.SecurityUser;
import com.tian.framework.security.server.ISecurityService;
import com.tian.system.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Configuration
public class SecurityServiceImpl implements ISecurityService {
    @Autowired
    private IUserService userService;

    /**
     * 查询用户表信息
     *
     * @param userName 用户名
     * @return 用户表信息
     */
    @Override
    public SecurityUser selectSecurityUserByName(String userName) {
        return userService.selectUserByName(userName);
    }
    /**
     * 查询用户表信息
     *
     * @param keycloakId keycloak用户编号
     * @return 用户表信息
     */
    @Override
    public SecurityUser selectUserByKeycloakId(String keycloakId) {
        return userService.selectUserByKeycloakId(keycloakId);
    }
    /**
     * 查询用户所有菜单权限标识
     *
     * @param userId 用户表ID
     * @return 用户表信息
     */
    @Override
    public List<String> selectUserPermissionByUserId(int userId) {
        return userService.selectUserPermissionByUserId(userId);
    }
}
